package com.reservation.util;

import lombok.Data;

@Data
public class PageParam {
    private Integer pageNum = 1;  // 当前页码，默认第1页
    private Integer pageSize = 10;  // 每页显示数量，默认10条
    private Integer total;  // 总记录数
    private Integer totalPages;  // 总页数
    
    public Integer getOffset() {
        return (pageNum - 1) * pageSize;
    }
    
    public void setTotal(Integer total) {
        this.total = total;
        this.totalPages = (total + pageSize - 1) / pageSize;
    }
} 